<template>
	<view class="my-conter">
		<view class="my-conter-top-box">
			<u-image shape="circle" :fade="true" duration="450" width="136rpx" height="136rpx" :src="baseImgUrl+userMsg.headImg"></u-image>
			<view class="top-title">
				<view class="title">
					{{userMsg.userName}}
				</view>
				<view class="user-type">
					{{userMsg.userType==1?'个人':'企业'}}用户
				</view>
			</view>
		</view>
		<view class="my-vip-bg" @click="handToAtuh">
			<image class="my-vip-bg-img" :src="imgUrl+'my-bg.png'" mode=""></image>
			<view class="title-box">
				<view class="vip-title">
					<view class="title">
						中国建筑装饰协会会员认证
					</view>
					<view class="cont">
						会员身份认证+专属权益
					</view>
				</view>
				<view class="vip-icon">
					立即认证
				</view>
			</view>
		</view>
		<view class="nav-list-box">
			<view class="nav-list">
				<view class="item" v-for="item in navList" @click="handNavTo(item)">
					<image v-if="imgUrl" class="icon" :src="imgUrl+item.img+'.png'" mode=""></image>
					<text class="title">{{item.name}}</text>
				</view>
			</view>
			<view class="group-box">
				<u-cell-group>
					<u-cell-item @click='handMsgTo("/myMsg/myMsg")' title="我的信息"></u-cell-item>
					<u-cell-item @click='handMsgTo("/publisherMsg/publisherMsg")' title="发布者信息"></u-cell-item>
					<u-cell-item @click='handMsgTo("/myInfo/myInfo")' title="我的消息"></u-cell-item>
				</u-cell-group>
			</view>
			<view class="log-out">
				退出登录
			</view>
		</view>

	</view>
</template>

<script>
	import {
		baseImgUrl,
		baseURL
	} from '@/config/config.js'
	export default {
		props: {
			userMsg: {
				type: Object,
				default: () => {}
			}
		},
		data() {
			return {
				baseImgUrl: baseImgUrl,
				imgUrl: this.configImgUrl,
				navList: [{
						name: '档案申报',
						img: 'dangan',
						path: 'recordDeclare/recordDeclare'
					},
					{
						name: '奖项申报',
						img: 'jiangxiang',
						path: 'awardsDeclare/awardsDeclare'
					},
					{
						name: '我的活动',
						img: 'huodong',
						path: 'myActiveity/myActiveity'
					},
					{
						name: '我的收藏',
						img: 'shoucang',
						path: 'myCollect/myCollect'
					},
				]
			};
		},
		methods: {
			handToAtuh() {
				uni.navigateTo({
					url: '/pages/my/authVip/auth'
				})
			},
			handMsgTo(path) {
				uni.navigateTo({
					url: '/pages/my' + path
				})
			},
			handNavTo(item) {
				uni.navigateTo({
					url: '/pages/my/' + item.path
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.my-conter {
		width: 100%;

		.nav-list-box {
			padding: 0 30rpx;

			.log-out {
				color: $bs-text-color-999;
				font-size: 28rpx;
				text-align: center;
			}

			.group-box {
				overflow: hidden;
				background: #FFFFFF;
				box-shadow: 0 0 26px 0 rgba(18, 27, 83, 0.07);
				border-radius: 12px;
				margin-bottom: 114rpx;
			}

			.nav-list {
				margin-bottom: 26rpx;
				height: 170rpx;
				width: 100%;
				padding: 0 44rpx;
				background: #FFFFFF;
				box-shadow: 0 0 26px 0 rgba(18, 27, 83, 0.07);
				border-radius: 12px;
				@include my-flex($fd: row, $ai:center, $jc:$bs-sb);

				.item {
					@include my-flex($fd: column, $ai:center);

					.icon {
						width: 68rpx;
						height: 65rpx;

					}

					.title {
						font-size: 26rpx;
						color: #333333;
						margin-top: 6rpx;
					}
				}
			}
		}

		.my-vip-bg {
			width: 100%;
			height: 228rpx;
			margin-top: -114rpx;
			position: relative;
			padding: 0 66rpx;

			.title-box {
				position: absolute;
				// width: 100%;
				height: 100%;
				@include my-flex($jc: $bs-sb, $ai:center);
				z-index: 2;

				.vip-icon {
					margin-left: 82rpx;
					background: #71452C;
					border-radius: 6px;
					width: 138rpx;
					height: 56rpx;
					color: #FFFFFF;
					font-size: 26rpx;
					line-height: 56rpx;
					text-align: center;
				}

				.title {
					color: #673521;
					font-size: 34rpx;
					font-weight: bold;
					margin-bottom: 8rpx;
				}

				.cont {
					color: #71452C;
					font-size: 28rpx;
				}
			}

			.my-vip-bg-img {
				width: 100%;
				height: 100%;
				position: absolute;
				top: 0;
				left: 0;
			}
		}

		.my-conter-top-box {
			background-color: $bs-color-theme;
			height: 300rpx;
			width: 100%;
			padding: 40rpx 30rpx;
			@include my-flex();

			.top-title {
				@include my-flex($fd: column, $jc:center);
				height: 136rpx;
				margin-left: 24rpx;

				.title {
					margin-bottom: 16rpx;
					color: #fff;
					font-size: 40rpx;
				}

				.user-type {
					font-size: 32rpx;
					color: #FFFFFF;
					opacity: 0.6;
				}
			}
		}
	}
</style>
